"use strict";
/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-28 08:58:40
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-28 10:04:46
 */
/*
字面量+联合
// 字面量
let  name:'jack'='jack'
// 联合
let name2:string='jack'|'tom'

*/
exports.__esModule = true;
/* 枚举-基本使用 */
var Direction;
(function (Direction) {
    Direction["up"] = "up";
    Direction["down"] = "down";
    Direction["left"] = "left";
    Direction["right"] = "right";
})(Direction || (Direction = {}));
function fx(direction) {
    console.log(direction);
}
fx(Direction.up);
/* 枚举类型的应用场景 */
var Gender;
(function (Gender) {
    Gender[Gender["girl"] = 0] = "girl";
    Gender[Gender["boy"] = 1] = "boy";
})(Gender || (Gender = {}));
var user = {
    id: 1,
    name: 'jack',
    gender: Gender.boy
};
/* any */
var n1 = 'jack';
// n1 = 222
var f2 = function () { };
var n2;
/* 类型断言 */
// const box = document.getElementById('img') as HTMLImageElement
// console.log(box.src) // ts报错
// type User2 = {
//   name: string
//   age: number
// }
// const u1 = {} as User2
// console.log(u1.age) // 这里就会有提示
// list:[]==list.id
var res = { name: '小花', city: '武汉', skills: ['js', 'css'] };
function f3(obj) { }
f3(res);
console.log(typeof res); //
